package flib;

import java.util.Vector;

import processing.core.PGraphics;


import simpleGeom.HasPos2D;

public class Split implements Comparable{
	boolean checked;
Vector<FlibHEdge>hEdges=new Vector<FlibHEdge>();
int startI;
float start;
int endI;
float end;

public Vector<HasPos2D>getPts(){
	Vector<HasPos2D> pts=new Vector<HasPos2D>();
	FlibHEdge hE=null;
	for (int i = 0; i < hEdges.size(); i++) {
		 hE = hEdges.get(i);
		pts.add(hE.getOrg());
	}
	pts.add(hE.getDest());
	return pts;
}

float getLength(){
	float sum=0;
	for (int i = 0; i < hEdges.size(); i++) {
		FlibHEdge hE = hEdges.get(i);
		sum+=hE.getLength();
	}
	return sum;
}

public int compareTo(Object arg0) {
	// TODO Auto-generated method stub
	Split split=(Split) arg0;
	return Float.compare(getLength(), split.getLength());
}
HasPos2D getStart(){
	return hEdges.firstElement().getOrg();
}
HasPos2D getEnd(){
	return hEdges.lastElement().getDest();
}
public void display(PGraphics g2d){
	for (int j=0;j<hEdges.size();j++){
		FlibHEdge hE=hEdges.get(j);
		hE.display(g2d);
	}
}
}
